
const Router = require('@koa/router');

const bigScreenRouter = new Router({ prefix: '/bg' })

bigScreenRouter.get('/users',(ctx) => {
  const gbOnLineUsers = ctx.gbOnLineUsersMap;
  // console.log('--gbOnLineUsers---:',gbOnLineUsers);

  const gbOnLineUsersObj ={}
  for(let [key, value] of gbOnLineUsers.entries()) {
    const { entId,personId,timeMap } = value;
    gbOnLineUsersObj[key] = {entId,personId,timeMap};
  }


  ctx.body = {
    suc: true,
    data: gbOnLineUsersObj
  }
})

module.exports = bigScreenRouter;

